const webpack = require('webpack')
const merge = require('webpack-merge')
const baseConfig = require('./webpack.config.base')

const devServer = {
  port: 5000,
  hotOnly: true,
  compress: true,
  publicPath: '/',
  // quiet: true,
  disableHostCheck: true,
  historyApiFallback: true,
}

const config = {
  mode: 'development',

  devtool: 'cheap-module-source-map',

  devServer,

  entry: [
    `webpack-dev-server/client?http://localhost:${devServer.port}`,
    'webpack/hot/only-dev-server',
  ],

  output: {
    publicPath: '/',
  },

  plugins: [new webpack.HotModuleReplacementPlugin()],
}

module.exports = merge(baseConfig, config)
